<?php

declare(strict_types=1);

namespace app\home\controller;

use app\BaseController;
use app\home\model\BannerModel;

class Banner extends BaseController
{
    /**
     * 根据二级id查所属的商品信息
     * @param id $id
     * @return Array
     */
    public function index()
    {
        $DBBanner = new BannerModel();
        // 广告图
        $result = $DBBanner->select();
        return result($result);
    }
    public function find()
    {
        $page = $this->request->param('page');
        $DBOrder = new BannerModel();
        $info = $DBOrder->page($page, 11)->select();
        $count = $DBOrder->count();
        return result(['sub' => $info, 'count' => $count]);
    }
}
